package text;

public class List <T> {
    private final int MAX = 100;
    private T arr[] = (T [])new Object[MAX];
    private int len =0;
    //插入
    public void insert(T date){
        arr[len] = date;
        len++;
    }
    //获取数字

    //逆序
    public void  reverse(){
        for(int i=0;i<len/2;i++){
            T team = arr[i];
            arr[i] = arr[len-1-i];
            arr[len-1-i] = team;
        }
    }
    //排序

    //打印
    public void display(){
        if(len==0){
            System.out.println("此表是空表");
            return;
        }

        for(int i=0;i<len;i++){
            System.out.print( arr[i] + "  ");
        }
        System.out.println();
    }


}
